/*
Navicat MySQL Data Transfer

Source Server         : localhost
Source Server Version : 50516
Source Host           : 127.0.0.1:3306
Source Database       : ci-intro

Target Server Type    : MYSQL
Target Server Version : 50516
File Encoding         : 65001

Date: 2012-07-17 15:43:26
*/

SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `aodai`
-- ----------------------------
DROP TABLE IF EXISTS `aodai`;
CREATE TABLE `aodai` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT ,
`type`  tinyint(4) NULL DEFAULT NULL ,
`price`  bigint(11) NULL DEFAULT NULL ,
`note`  varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`image`  varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`material`  tinyint(4) NULL DEFAULT NULL ,
`created_date`  timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=9

;

-- ----------------------------
-- Records of aodai
-- ----------------------------
BEGIN;
INSERT INTO `aodai` VALUES ('2', '1', '2', '3', 'TT2.jpg', '2', '2012-05-21 09:50:19'), ('3', '2', '2', '2', 'TT3.jpg', '1', '2012-05-20 09:50:19'), ('4', '2', '127', '', 'TT4.jpg', '1', '2012-05-19 09:50:19'), ('6', '1', '2222', '', 'TT6.png', '4', '2012-05-17 09:50:19'), ('7', '1', '32767', 'jkjl', 'TT7.jpg', '1', '2012-06-22 16:04:15'), ('8', '1', '2000000000000', '33', 'TT8.', '1', '2012-06-28 15:49:39');
COMMIT;

-- ----------------------------
-- Table structure for `ci_sessions`
-- ----------------------------
DROP TABLE IF EXISTS `ci_sessions`;
CREATE TABLE `ci_sessions` (
`session_id`  varchar(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0' ,
`ip_address`  varchar(16) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '0' ,
`user_agent`  varchar(120) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`last_activity`  int(10) UNSIGNED NOT NULL DEFAULT 0 ,
`user_data`  text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
PRIMARY KEY (`session_id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci

;

-- ----------------------------
-- Records of ci_sessions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for `comment`
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`id`  bigint(20) NOT NULL AUTO_INCREMENT ,
`user_id`  int(11) NULL DEFAULT NULL ,
`comment`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci
AUTO_INCREMENT=8

;

-- ----------------------------
-- Records of comment
-- ----------------------------
BEGIN;
INSERT INTO `comment` VALUES ('4', '2', ' hahaff'), ('5', '2', ' a');
COMMIT;

-- ----------------------------
-- Table structure for `comment_detail`
-- ----------------------------
DROP TABLE IF EXISTS `comment_detail`;
CREATE TABLE `comment_detail` (
`comment_id`  bigint(11) NOT NULL ,
`user_id`  int(11) NOT NULL DEFAULT 0 ,
`comment_detail`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ,
`comment_detail_id`  int(11) NOT NULL AUTO_INCREMENT ,
PRIMARY KEY (`comment_detail_id`),
FOREIGN KEY (`comment_id`) REFERENCES `comment` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci
AUTO_INCREMENT=11

;

-- ----------------------------
-- Records of comment_detail
-- ----------------------------
BEGIN;
INSERT INTO `comment_detail` VALUES ('4', '2', ' ujj', '10');
COMMIT;

-- ----------------------------
-- Table structure for `donhang`
-- ----------------------------
DROP TABLE IF EXISTS `donhang`;
CREATE TABLE `donhang` (
`madh`  int(11) NOT NULL AUTO_INCREMENT ,
`user_id`  int(11) NOT NULL DEFAULT 0 ,
`ngay_thaydoi`  timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`ngay_dat`  timestamp NULL DEFAULT NULL ,
`tongtien`  int(11) NULL DEFAULT NULL ,
`sodo1`  int(11) NULL DEFAULT NULL ,
`sodo2`  int(11) NULL DEFAULT NULL ,
`pay_type`  int(11) NULL DEFAULT NULL COMMENT '1:atm,2:paypal' ,
`status_pay`  int(11) NULL DEFAULT NULL COMMENT '0:not pay,1:pay 50%,2:pay 100%' ,
`status_delivery`  int(11) NULL DEFAULT NULL COMMENT '0:not delivery 1: deliveried ' ,
PRIMARY KEY (`madh`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci
AUTO_INCREMENT=46

;

-- ----------------------------
-- Records of donhang
-- ----------------------------
BEGIN;
INSERT INTO `donhang` VALUES ('14', '2', '2012-05-18 06:11:35', '2012-05-18 06:11:35', null, '111', '222', null, null, null), ('17', '2', '2012-05-18 06:17:45', '2012-05-18 06:17:45', null, '111', '222', null, null, null), ('20', '2', '2012-05-18 06:24:40', '2012-05-18 06:24:40', null, '111', '222', null, null, null), ('21', '2', '2012-05-18 06:25:05', '2012-05-18 06:25:05', null, '111', '222', null, null, null), ('22', '2', '2012-05-18 06:26:39', '2012-05-18 06:26:39', null, '111', '222', null, null, null), ('23', '2', '2012-05-18 07:06:16', '2012-05-18 07:06:16', null, '22', '22', null, null, null), ('24', '2', '2012-05-18 07:38:48', '2012-05-18 07:38:48', null, '22', '22', null, null, null), ('25', '2', '2012-05-18 07:50:13', '2012-05-18 07:50:13', null, '22', '22', null, null, null), ('26', '2', '2012-05-18 07:50:42', '2012-05-18 07:50:42', null, '111', '333', null, null, null), ('27', '2', '2012-05-18 07:51:44', '2012-05-18 07:51:44', null, '111', '333', null, null, null), ('28', '2', '2012-05-18 07:52:23', '2012-05-18 07:52:23', null, '111', '333', null, null, null), ('29', '2', '2012-05-18 07:52:38', '2012-05-18 07:52:38', null, '111', '333', null, null, null), ('30', '7', '2012-05-21 03:37:39', '2012-05-21 03:37:39', null, '111', '333', null, null, null), ('31', '7', '2012-05-21 10:38:08', '2012-05-21 03:38:08', '254', '111', '333', null, null, null), ('32', '8', '2012-05-21 10:44:09', '2012-05-21 03:44:09', '381', '55', '66', null, null, null), ('33', '8', '2012-05-21 10:47:56', '2012-05-21 03:47:56', '381', '0', '0', null, null, null), ('34', '8', '2012-05-21 10:48:02', '2012-05-21 03:48:02', '381', '0', '0', null, null, null), ('35', '8', '2012-05-21 10:51:18', '2012-05-21 03:51:18', '381', '0', '0', null, null, null), ('36', '2', '2012-05-30 15:12:34', '2012-05-30 08:12:33', '2224', '0', '0', null, null, null), ('37', '2', '2012-05-30 15:16:44', '2012-05-30 08:16:44', '2224', '0', '0', null, null, null), ('38', '2', '2012-06-22 13:30:02', '2012-06-22 06:30:02', '2', '0', '0', null, null, null), ('39', '2', '2012-06-22 13:42:49', '2012-06-22 06:42:49', '2', '0', '0', null, null, null), ('40', '2', '2012-06-22 13:47:56', '2012-06-22 06:47:56', '2', '0', '0', null, null, null), ('41', '2', '2012-06-22 13:53:44', '2012-06-22 06:53:44', '2', '0', '0', null, null, null), ('42', '2', '2012-06-22 14:06:56', '2012-06-22 07:06:56', '2', '0', '0', null, null, null), ('43', '2', '2012-06-22 15:14:06', '2012-06-22 07:16:47', '2', '0', '0', '1', null, null), ('44', '2', '2012-06-25 13:42:34', '2012-06-25 06:42:09', '2', '0', '0', '2', null, null), ('45', '2', '2012-06-28 16:25:44', '2012-06-28 09:25:44', '2222', '0', '0', null, null, null);
COMMIT;

-- ----------------------------
-- Table structure for `donhang_chitiet`
-- ----------------------------
DROP TABLE IF EXISTS `donhang_chitiet`;
CREATE TABLE `donhang_chitiet` (
`madh`  int(11) NOT NULL DEFAULT 0 ,
`ma_aodai`  int(11) NOT NULL DEFAULT 0 ,
`giatien`  int(11) NULL DEFAULT NULL ,
`soluong`  int(11) NULL DEFAULT NULL ,
PRIMARY KEY (`madh`, `ma_aodai`),
FOREIGN KEY (`madh`) REFERENCES `donhang` (`madh`) ON DELETE CASCADE ON UPDATE RESTRICT
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci

;

-- ----------------------------
-- Records of donhang_chitiet
-- ----------------------------
BEGIN;
INSERT INTO `donhang_chitiet` VALUES ('14', '2', '2', '1'), ('14', '3', '2', '1'), ('17', '2', '2', '1'), ('17', '3', '2', '1'), ('20', '2', '2', '1'), ('20', '3', '2', '1'), ('21', '2', '2', '1'), ('21', '3', '2', '1'), ('22', '2', '2', '1'), ('22', '3', '2', '1'), ('23', '2', '2', '1'), ('23', '3', '2', '1'), ('24', '2', '2', '1'), ('24', '3', '2', '1'), ('25', '2', '2', '1'), ('25', '3', '2', '1'), ('26', '2', '2', '1'), ('26', '3', '2', '1'), ('27', '2', '2', '1'), ('27', '3', '2', '1'), ('28', '2', '2', '1'), ('28', '3', '2', '1'), ('29', '2', '2', '1'), ('29', '3', '2', '1'), ('31', '5', '127', '2'), ('32', '4', '127', '1'), ('32', '5', '127', '2'), ('33', '4', '127', '1'), ('33', '5', '127', '2'), ('34', '4', '127', '1'), ('34', '5', '127', '2'), ('35', '4', '127', '1'), ('35', '5', '127', '2'), ('36', '0', '0', '1'), ('36', '3', '2', '1'), ('36', '6', '2222', '1'), ('37', '2', '2', '1'), ('37', '6', '2222', '1'), ('38', '0', '0', '1'), ('38', '2', '2', '1'), ('39', '2', '2', '1'), ('40', '2', '2', '1'), ('41', '2', '2', '1'), ('42', '0', '0', '1'), ('42', '2', '2', '1'), ('43', '2', '2', '1'), ('44', '0', '0', '1'), ('44', '2', '2', '1'), ('45', '0', '0', '1'), ('45', '6', '2222', '1');
COMMIT;

-- ----------------------------
-- Table structure for `top10score`
-- ----------------------------
DROP TABLE IF EXISTS `top10score`;
CREATE TABLE `top10score` (
`name`  varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' ,
`point`  int(11) NULL DEFAULT NULL ,
PRIMARY KEY (`name`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci

;

-- ----------------------------
-- Records of top10score
-- ----------------------------
BEGIN;
INSERT INTO `top10score` VALUES ('11', '56'), ('12', '12222222'), ('123', '33333'), ('1234', '1234'), ('12345', '12345'), ('123456', '1111111'), ('2', '222222222'), ('4', '444444444'), ('6', '66666');
COMMIT;

-- ----------------------------
-- Table structure for `type_aodai`
-- ----------------------------
DROP TABLE IF EXISTS `type_aodai`;
CREATE TABLE `type_aodai` (
`id`  smallint(6) NOT NULL AUTO_INCREMENT ,
`name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`name_short`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`name_eng`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=9

;

-- ----------------------------
-- Records of type_aodai
-- ----------------------------
BEGIN;
INSERT INTO `type_aodai` VALUES ('1', 'Truyền Thống', 'TT', 'Tradition'), ('2', 'Cách Tân', 'CT', 'Modern'), ('6', 'Cưới Hỏi', 'CH', 'Wedding'), ('8', 'testt', 'tt444', null);
COMMIT;

-- ----------------------------
-- Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id`  tinyint(4) NOT NULL AUTO_INCREMENT ,
`username`  varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`password`  varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`role`  tinyint(4) NULL DEFAULT 0 COMMENT '0:user binh thuong; 1: admin' ,
`registed_date`  timestamp NULL DEFAULT NULL ,
`updated_date`  timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`email`  varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`ip_address`  varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL ,
`is_actived`  tinyint(4) NULL DEFAULT 0 ,
PRIMARY KEY (`user_id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci
AUTO_INCREMENT=14

;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('1', 'admin', 'minhkhang', '1', null, '2012-05-21 16:55:31', null, null, '1'), ('2', 'user1', '123456', '0', null, '2012-05-30 15:12:00', 'colu85@yahoo.com', null, '1'), ('4', 'he', '123456', '0', null, '2012-05-18 16:20:40', 'colu85@yahoo.com', '127.0.0.1', '0'), ('5', 'he', '123456', '0', null, '2012-05-18 16:21:53', 'colu85@yahoo.com', '127.0.0.1', '0'), ('6', 'he', '123456', '0', null, '2012-05-18 16:24:35', 'colu85@yahoo.com', '127.0.0.1', '0'), ('7', 'he', '123456', '0', null, '2012-05-18 16:26:21', 'colu85@yahoo.com', '127.0.0.1', '1'), ('8', 'hotaru', '123456', '0', null, '2012-05-21 10:42:48', 'colu85@yahoo.com', '127.0.0.1', '1'), ('13', 'user2', '123456', '0', null, '2012-06-29 11:23:00', 'colu85@gmail.com', '127.0.0.1', '1');
COMMIT;

-- ----------------------------
-- Table structure for `user_sodo`
-- ----------------------------
DROP TABLE IF EXISTS `user_sodo`;
CREATE TABLE `user_sodo` (
`user_id`  int(11) NOT NULL DEFAULT 0 ,
`sodo1`  int(11) NULL DEFAULT NULL ,
`sodo2`  int(11) NULL DEFAULT NULL ,
PRIMARY KEY (`user_id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci

;

-- ----------------------------
-- Records of user_sodo
-- ----------------------------
BEGIN;
INSERT INTO `user_sodo` VALUES ('2', '111', '44'), ('7', '111', '333'), ('8', '55', '66');
COMMIT;

-- ----------------------------
-- Auto increment value for `aodai`
-- ----------------------------
ALTER TABLE `aodai` AUTO_INCREMENT=9;

-- ----------------------------
-- Indexes structure for table `ci_sessions`
-- ----------------------------
CREATE INDEX `last_activity_idx` ON `ci_sessions`(`last_activity`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `comment`
-- ----------------------------
ALTER TABLE `comment` AUTO_INCREMENT=8;

-- ----------------------------
-- Indexes structure for table `comment_detail`
-- ----------------------------
CREATE INDEX `gg` ON `comment_detail`(`comment_id`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `comment_detail`
-- ----------------------------
ALTER TABLE `comment_detail` AUTO_INCREMENT=11;

-- ----------------------------
-- Indexes structure for table `donhang`
-- ----------------------------
CREATE INDEX `madh` ON `donhang`(`madh`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `donhang`
-- ----------------------------
ALTER TABLE `donhang` AUTO_INCREMENT=46;

-- ----------------------------
-- Indexes structure for table `donhang_chitiet`
-- ----------------------------
CREATE INDEX `madh` ON `donhang_chitiet`(`madh`) USING BTREE ;

-- ----------------------------
-- Auto increment value for `type_aodai`
-- ----------------------------
ALTER TABLE `type_aodai` AUTO_INCREMENT=9;

-- ----------------------------
-- Auto increment value for `user`
-- ----------------------------
ALTER TABLE `user` AUTO_INCREMENT=14;
